import Storage from "web-storage-cache"

const localStorage = new Storage()

export const set = (key, value, expires=7) => {
    return localStorage.set(key, value, {exp : 3600 * 24 * expires})
}

export const get = (key) => {
    return localStorage.get(key)
}

export const remove = (key) => {
    return localStorage.delete(key)
}

export const clear = () => {
    return localStorage.clear()
}

export const saveLocale = (locale)=>{
    return localStorage.set('locale',locale)
}
export const getLocale = ()=>{
    return localStorage.get('locale')
}